package onlineCodingQuiz

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method("GET")
        url(value(producer("/api/v3/onlineCodingQuizzes/1/status")
                , consumer(regex("/api/v3/onlineCodingQuizzes/\\d+/status"))))
    }
    response {
        status(200)
        body("""
            {
                "status":1,
                "logs":"123123"
            }
        """)
        bodyMatchers {
            jsonPath('$.status', byRegex(number()))
            jsonPath('$.logs', byRegex("[\\s\\S]+"))
        }
        headers {
            contentType(applicationJsonUtf8())
        }
    }
}
